#include <iostream>

int length_number(int, int[], int);

int main()
{
	int numbers[20];

	std::cout << "Enter numbers (enter -1 to quit):\n";

	int num = 0;
	int n = 0;
	
	do
	{
		std::cin >> num;

		if(num != -1)
		{
			numbers[n] = num;
			++n;				
		}		
	}
	while(num != -1);
	
	int index = 0;
	int max = 0;
	int value = 0;

	do
	{
		value = length_number(index,numbers,n) + 1;
		
		if(value > max && value > 1)
		{
			max = value;
		}

		index += value;
	}
	while(index < n);
	
	std::cout << "Numbers: ";

	for(int i = 0; i < n; ++i)
	{
		std::cout << numbers[i] << " ";
	}
	
	std::cout << "\nMaximum length: " << max << "\n\n";
	
	return 0;
}

int length_number(int index, int numbers[], int n)
{
	int length = 0;
	for(int i = index; i < n - 1; ++i)
	{
		if(numbers[i] <= numbers[i+1])
		{
			++length;
		}
		else
		{
			break;
		}
	} 
	return length;
}